package com.qianji.api;

import com.qianji.pojo.ActiveDto;
import com.qianji.utils.Result;
import com.qianji.vo.ActiveAddVO;
import com.qianji.vo.ActiveUpdateVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 钟丽诗
 * @Date 2021.3.15
 */
@RestController
public interface ActiveApps {

    @PutMapping("active/add")
    @ApiOperation("添加活动")
    @ResponseBody
    Result addActive(@RequestBody ActiveAddVO activeAddVO);

    @DeleteMapping("active/delete")
    @ApiOperation("删除活动")
    @ResponseBody
    Result deletActiveById(@RequestBody String id);

    @PostMapping("active/update")
    @ApiOperation("修改活动" )
    @ResponseBody
    Result updateActive(@RequestBody ActiveUpdateVO activeUpdateVO);

    @PostMapping("active/select")
    @ApiOperation("查询所有活动")
    @ResponseBody
    Result selectAll(@RequestBody ActiveDto activeDto);

    @PostMapping("active/find")
    @ApiOperation("根据id查询活动")
    @ResponseBody
    Result findActiveById(@RequestBody String id);

    @PostMapping("active/onoff")
    @ApiOperation("关闭或开启活动")
    @ResponseBody
    Result openAndCloseActiveById(@RequestBody String id);

    @RequestMapping(value = "active/findById",method = RequestMethod.POST)
    @ApiOperation("根据活动id查询")
    Result<ActiveDto> selectById( @RequestBody  ActiveDto activeDto);

}
